package com.fastjrun.eladmin.itrms.domain;

import com.fastjrun.eladmin.itrms.common.exception.DomainException;

public enum DEPLOY_WAY {
    HOST(1,"host"),
    DOCKER(2,"docker"),
    K8S(3,"k8s");

    DEPLOY_WAY(int key, String value){
        this.key =key;
        this.value =value;
    }
    private int key;
    private String value;

    public static String getValue(int key){
        for(DEPLOY_WAY server_type: DEPLOY_WAY.values()){
            if(server_type.key==key){
                return server_type.value;
            }
        }
        throw new DomainException(String.format("the enum DEPLOY_WAY for key:%d not provided.",key));
    }


}
